<template>
    <div class="electronic-form-block">
        <div class="electronic-title">报关企业登记信息</div>
        <Form class="declare-form" :model="form" :label-width="150">
            <FormItem label="海关管理类别">
                <Input
                    :value="form.customsAdminCategories | customsFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="报关注册登记日期">
                <Input
                    v-model="form.declareRegistDate"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="所属地区">
                <Input
                    v-model="form.area"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业性质">
                <Input
                    :value="form.enterpriseNature | natureFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="是否为优秀报关行">
                <Input
                    :value="form.goodCustomsBroker | isFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="优秀报关企业被评时间">
                <Input
                    v-model="form.selectionDate"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="评定单位">
                <Input
                    v-model="form.selectionUnit"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="中国报关协会会员企业">
                <Input
                    :value="form.ccbaMember | vipFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="地方报关协会会员企业">
                <Input
                    :value="form.lcdaMember | vipFmt"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem class="span-16" label="单位地址">
                <Input
                    v-model="form.unitAddress"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="邮政编码">
                <Input
                    v-model="form.postalCode"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem class="span-24" label="企业简介">
                <Input
                    v-model="form.enterpriseProfile"
                    :disabled="disabled"
                    type="textarea"
                />
            </FormItem>
            <FormItem label="企业电子邮箱">
                <Input
                    v-model="form.email"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业固定电话">
                <Input
                    v-model="form.tel"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业传真">
                <Input
                    v-model="form.tax"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="企业移动电话">
                <Input
                    v-model="form.mobile"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="法人姓名">
                <Input
                    v-model="form.legalPersonName"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="法人固定电话">
                <Input
                    v-model="form.legalPersonTel"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="法人电子邮箱">
                <Input
                    v-model="form.legalPersonEmail"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="法人移动电话">
                <Input
                    v-model="form.legalPersonMobile"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="总经理姓名">
                <Input
                    v-model="form.generalManagerName"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="总经理固定电话">
                <Input
                    v-model="form.generalManagerTel"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="总经理电子邮箱">
                <Input
                    v-model="form.generalManagerEmail"
                    :disabled="disabled"
                />
            </FormItem>
            <FormItem label="总经理移动电话">
                <Input
                    v-model="form.generalManagerMobile"
                    :disabled="disabled"
                />
            </FormItem>
        </Form>
    </div>
</template>
<script>
import filters from '../mixins/filters'

export default {
    mixins: [ filters ],
    props: {
        value: {
            type: Object,
            default: () => ({})
        }
    },
    data () {
        return {
            disabled: true,
            form: {}
        }
    },
    watch: {
        value: {
            handler (v) {
                this.setForm(v)
            },
            immediate: true
        }
    },
    methods: {
        setForm (v) {
            this.form = JSON.parse(JSON.stringify(v))
        }
    }
}
</script>
